import type { PageList, ResponseStruct } from '#/global'

export interface CourseTaglVo {
  id?:number;
  name?: string
}

export interface CourseTaglSearchVo {
  name?: string
}

export function page(data: CourseTaglSearchVo): Promise<ResponseStruct<PageList<CourseTaglVo>>> {
  return useHttp().get('/admin/course-tag', { params: data })
}

export function create(data: CourseTaglVo): Promise<ResponseStruct<null>> {
  return useHttp().post('/admin/course-tag', data)
}

export function save(id: number, data: CourseTaglVo): Promise<ResponseStruct<null>> {
  return useHttp().put(`/admin/course-tag/${id}`, data)
}

export function deleteByIds(ids: number[]): Promise<ResponseStruct<null>> {
  return useHttp().delete('/admin/course-tag', { data: ids })
}

export function all(params = {}): Promise<ResponseStruct<CourseTaglVo[]>> {
  return useHttp().get('/admin/course-tag/all', { params })
}
